<template>
  <div class="headWrap" :class="{'headChang':headChang}">
    <div class="headWrapLeft">
      <div class="headWrapLeftBox">
        <img
          class="Left1"
          v-show="BackType1"
          @click="goback()"
          src="@/assets/img/ArrowLeft.png"
          alt
        >
        <div class="Left2" v-show="BackType2">
          <img src="@/assets/img/ArrowLeft.png" alt @click="goback()">
          <div class="headWrapLeftText" @click="goback()">{{BackType2Num}}</div>
        </div>
        <div class="Left3" v-show="BackType3">取消</div>
        <img
          class="Left1 Left4"
          v-show="BackType4"
          @click="goback()"
          src="@/assets/img/ArrowLeftWhite.png"
          alt
        >
      </div>
    </div>
    <div class="headWrapMain overflow" :class="{'headChang':headChang}">{{title}}</div>
    <div class="headWrapRight">
      <div>
        <!-- 带圈添加符号 -->
        <img class="img1" v-show="NoticeType1" @click="append()" src="@/assets/img/addInfo.png" alt>
        <!-- 三个点 -->
        <img class="img2" v-show="NoticeType2" @click="point()" src="@/assets/img/infoicon.png" alt>
        <div class="img3" v-show="NoticeType3" @click="success()">完成</div>
        <div
          class="img4"
          :class="{'img4Color':NoticeType4Color}"
          v-show="NoticeType4"
          @click="editor()"
        >编辑</div>
        <div class="img5" v-show="NoticeType5" @click="del()">删除</div>
        <div class="img6" v-show="NoticeType6" @click="cancel()">取消</div>
        <div class="img3 img7" v-show="NoticeType7">完成</div>
        <div class="img3 img8" v-show="NoticeType8" @click="successnum()">完成{{NoticeType8Num}}</div>
        <img
          class="img2"
          v-show="NoticeType9"
          @click="pointWhite()"
          src="@/assets/img/infoiconWhite.png"
          alt
        >
        <div class="img8" v-show="NoticeType10" :class="{'headChang':headChang}" @click="customEvevt()">{{TxtRight}}</div>
        <div class="img3" v-show="NoticeType11" @click="customEvevt()">{{TxtRight}}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "headWrap",
  data() {
    return {};
  },
  props: [
    "title",
    "BackType1",
    "BackType2",
    "BackType2Num",
    "BackType3",
    "BackType4",
    "NoticeType1",
    "NoticeType2",
    "NoticeType3",
    "NoticeType4",
    "NoticeType4Color",
    "NoticeType5",
    "NoticeType6",
    "NoticeType7",
    "NoticeType8",
    "NoticeType9",
    "NoticeType10",
    "NoticeType11",
    "NoticeType8Num",
    "headChang",
    "TxtRight"
  ],
  methods: {
    /* 返回上一页 */
    goback() {
      this.$router.go(-1);
    },
    /**
     * 向父组件传递事件方法，
     * 子组件传递事件：del(){'this.$emit('DelClick')'}
     * 父组件接收事件：<Head v-on:DelClick="DelClick"></Head>
     * 父组件定义事件：DelClick(){console.log(1)}
     */
    append() {
      //添加（圆圈带加号）
      this.$emit("AppendClick");
    },
    point() {
      //点（三个点）
      this.$emit("PointClick");
    },
    success() {
      //成功（文字成功）
      this.$emit("SuccessClick");
    },
    editor() {
      //编辑（文字编辑）
      this.$emit("EditorClick");
    },
    del() {
      //删除 （文字删除）
      this.$emit("DelClick");
    },
    cancel() {
      //取消（文字取消）
      this.$emit("cancelClick");
    },
    successnum() {
      //完成（完成带数字）
      this.$emit("cancelClick");
    },
    pointWhite() {
      this.$emit("pointWhiteClick");
    },
    customEvevt() {
      this.$emit("CustomEvevt");
    }
  }
};
</script>

<style scoped lang="less">
.headWrap {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  background-color: #ffffff;
  width: 100%;
  height: 88px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  line-height: 88px;
  font-family: PingFangSC-Medium;
  color: rgba(0, 0, 0, 1);

  .headWrapLeft {
    padding-left: 30px;
    width: 200px;

    .headWrapLeftBox {
      height: 88px;
      display: flex;
      flex-direction: row;
      align-items: center;
      .Left1 {
        width: 20px;
        height: 32px;
      }
      .Left2 {
        height: 88px;
        display: flex;
        align-items: center;
        height: 100%;

        img {
          width: 20px;
          height: 30px;
        }

        .headWrapLeftText {
          height: 48px;
          background: #d5d5d5;
          padding: 0 15px;
          margin-left: 10px;
          line-height: 48px;
          border-radius: 24px;
        }
      }
      .Left3 {
        font-size: 32px;
        color: #323232;
        font-family: PingFangSC-Light;
      }
    }
  }

  .headWrapMain {
    height: 88px;
    width: 290px;
    text-align: center;
    font-size: 32px;
    font-weight: 500;
  }

  .headWrapRight {
    padding-right: 30px;
    width: 200px;

    div {
      display: flex;
      height: 88px;
      flex-direction: row-reverse;
      align-items: center;
      font-family: PingFangSC-Medium;
      .img1 {
        width: 45px;
        height: 45px;
      }

      .img2 {
        width: 37px;
        height: 6px;
      }

      .img3 {
        padding: 0 26px;
        height: 64px;
        line-height: 64px;
        width: auto;
        background: #07c160;
        border-radius: 5px;
        color: #ffffff;
        font-size: 32px;
      }

      .img4 {
        font-size: 32px;
        color: #5b7ef9;
        font-family: PingFangSC-Regular;
      }
      .img4Color {
        color: #07c160;
      }
      .img5 {
        font-size: 28px;
        color: #646464;
        font-family: PingFangSC-Regular;
      }
      .img6 {
        font-size: 28px;
        font-family: PingFangSC-Regular;
        color: #646464;
      }
      .img7 {
        opacity: 0.3;
      }
      .img8 {
        font-size: 32px;
        color: #fff;
      }
    }
  }
}
.headChang {
  background: #000;
  color: #fff;
}
</style>
